--NV.lua
-- Night vision like effect.
-- uses the saturation channel,
-- so it won't work with greyscale images.

for y = 0, height - 1 do
  for x = 0, width - 1 do
    r, g, b = get_hsv(x, y)
b=1-b
b=b+(math.random()-.5)/5
if b<0 then
b=0
end
if b>1 then
b=1
end
    set_rgb(x, y, 0, b, 0)
  end
  progress(y / height)
end      

